package com.hafu.util;

//判断字符串是否为空
//判断输入用户，密码是否为空
public class StringUtil {
    public static boolean isEmpty(String str) {
        return str ==null || str.trim().length() == 0;
    }
    public static void main(String[] args) {
        //情况一
        String s1 = null;
        //情况二
        String s2 = "";
        System.out.println(s2);
        System.out.println((String) null);
        System.out.println(isEmpty(null));
        System.out.println(isEmpty(s2));

    }
}